#include "shapeparameter.h"

ShapeParameter* ShapeParameter::s_shapeParameterObj = nullptr;

ShapeParameter* ShapeParameter::getInstance()
{
	if (s_shapeParameterObj == nullptr)
	{
		s_shapeParameterObj = new ShapeParameter();
	}
	return s_shapeParameterObj;
}

void ShapeParameter::deleteGlobalData()
{
	delete s_shapeParameterObj;
	s_shapeParameterObj = nullptr;
}

void ShapeParameter::setDrawFlag(Canvas::DrawFlag flag)
{
	m_drawFlag = flag;
}

Canvas::DrawFlag ShapeParameter::getDrawFlag() const
{
	return m_drawFlag;
}

qreal ShapeParameter::getShapeScale()
{
	return m_shapeScale;
}

qreal ShapeParameter::getCanvasScale()
{
	return m_canvasScale;
}

void ShapeParameter::setShapeScale(qreal scale)
{
	m_shapeScale = scale;
}

void ShapeParameter::setCanvasScale(qreal scale)
{
	m_canvasScale = scale;
}

void ShapeParameter::setCurrentShape(Shape* shape)
{
	m_currentShape = shape;
}

Shape* ShapeParameter::getCurrentShape()
{
	return m_currentShape;
}

void ShapeParameter::setBorderWidth(int width)
{
	m_borderWidth = width;
	m_currentShape->setBorderWidth(width);
}

int ShapeParameter::getBorderWidth()
{
	return m_borderWidth;
}

void ShapeParameter::setBorderStyle(Qt::PenStyle style)
{
	m_borderStyle = style;
	m_currentShape->setBorderStyle(style);
}

Qt::PenStyle ShapeParameter::getBorderStyle()
{
	return m_borderStyle;
}

void ShapeParameter::setBorderColor(QRgb color)
{
	m_borderColor = color;
	m_currentShape->setBorderColor(color);
}

QRgb ShapeParameter::getBorderColor()
{
	return m_borderColor;
}

void ShapeParameter::setShapeColor(QRgb color)
{
	m_shapeColor = color;
	m_currentShape->setShapeColor(color);
}

QRgb ShapeParameter::getShapeColor()
{
	return m_shapeColor;
}